TOPE = 4000000

def fibo(n):
	if (n < 1): 
		return 0
	elif (n == 1) or (n == 2):
		return n
	else:
		return fibo(n-1) + fibo(n-2)

if __name__ == "__main__":
	suma = 0
	n = 1
	f = fibo(n)
	while (f <= TOPE):
		if (f % 2 == 0):
			suma += f
		n += 1
		f = fibo(n)
	print "\n", suma, "\n"
